import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime'
import 'dayjs/locale/zh-cn'
dayjs.extend(relativeTime)
dayjs.locale('zh-cn')
export const getRelativeTime = (time) => dayjs().to(dayjs(time))
export const formatTime = (time) => dayjs(time).format('YYYY-MM-DD')
